# Define the sources for the test executable
set(TEST_SOURCES
    test_algorl.cpp
    ${CMAKE_SOURCE_DIR}/src/algorl/src/AlgoRL.cpp
    ${CMAKE_SOURCE_DIR}/src/algorl/src/AlgoRLPrivate.cpp
    ${CMAKE_SOURCE_DIR}/src/algorl/src/RLPlanningEngine.cpp
    ${CMAKE_SOURCE_DIR}/src/algorl/src/RLPlatformData.cpp
    ${CMAKE_SOURCE_DIR}/src/algorl/src/RLResultWriter.cpp
    ${CMAKE_SOURCE_DIR}/src/algorl/src/RLGeneralizationEngine.cpp
    ${CMAKE_SOURCE_DIR}/src/algorl/src/RLRewardEngine.cpp
)

# Add the test executable
add_executable(test_algorl ${TEST_SOURCES})

# Add necessary include directories
target_include_directories(test_algorl PRIVATE
    ${CMAKE_SOURCE_DIR}/include
    ${CMAKE_SOURCE_DIR}/src/algorl/include
    ${CMAKE_SOURCE_DIR}/src/algorl/src 
    ${CMAKE_SOURCE_DIR}/third/NDimsArray
)

# Link against libNCore as AlgoRL depends on it
add_third(test_algorl libNCore)

# Add RL_DEBUG definition for Debug builds
target_compile_definitions(test_algorl PRIVATE $<$<CONFIG:Debug>:RL_DEBUG>)

# Always enable file logging for the test executable
target_compile_definitions(test_algorl PRIVATE RL_LOG_TO_FILE)

if(MSVC)
    set_target_properties(test_algorl PROPERTIES FOLDER "Tests")
endif()